package com.yunshan.mp.service.impl;

import java.util.List;

import com.yunshan.common.annotation.DataScope;
import com.yunshan.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yunshan.mp.mapper.MpServeBannerMapper;
import com.yunshan.mp.domain.MpServeBanner;
import com.yunshan.mp.service.IMpServeBannerService;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 服务设置bannerService业务层处理
 * 
 * @author yunshan
 * @date 2025-02-12
 */
@Service
public class MpServeBannerServiceImpl implements IMpServeBannerService 
{
    @Autowired
    private MpServeBannerMapper mpServeBannerMapper;

    /**
     * 查询服务设置banner
     * 
     * @param id 服务设置banner主键
     * @return 服务设置banner
     */
    @Override
    public MpServeBanner selectMpServeBannerById(Long id)
    {
        return mpServeBannerMapper.selectMpServeBannerById(id);
    }

    /**
     * 查询服务设置banner列表
     * 
     * @param mpServeBanner 服务设置banner
     * @return 服务设置banner
     */
    @Override
    @DataScope(deptAlias = "mp_serve_banner")
    public List<MpServeBanner> selectMpServeBannerList(MpServeBanner mpServeBanner)
    {
        return mpServeBannerMapper.selectMpServeBannerList(mpServeBanner);
    }

    /**
     * 新增服务设置banner
     * 
     * @param mpServeBanner 服务设置banner
     * @return 结果
     */
    @Override
    public int insertMpServeBanner(MpServeBanner mpServeBanner)
    {
        mpServeBanner.setCreateTime(DateUtils.getNowDate());
        return mpServeBannerMapper.insertMpServeBanner(mpServeBanner);
    }

    /**
     * 修改服务设置banner
     * 
     * @param mpServeBanner 服务设置banner
     * @return 结果
     */
    @Override
    public int updateMpServeBanner(MpServeBanner mpServeBanner)
    {
        mpServeBanner.setUpdateTime(DateUtils.getNowDate());
        return mpServeBannerMapper.updateMpServeBanner(mpServeBanner);
    }

    /**
     * 批量删除服务设置banner
     * 
     * @param ids 需要删除的服务设置banner主键
     * @return 结果
     */
    @Override
    public int deleteMpServeBannerByIds(Long[] ids)
    {
        return mpServeBannerMapper.deleteMpServeBannerByIds(ids);
    }

    /**
     * 删除服务设置banner信息
     * 
     * @param id 服务设置banner主键
     * @return 结果
     */
    @Override
    public int deleteMpServeBannerById(Long id)
    {
        return mpServeBannerMapper.deleteMpServeBannerById(id);
    }

    @Override
    public List<MpServeBanner> selectUniBanner(String serveType) {
        return mpServeBannerMapper.selectUniBanner(serveType);
    }
}
